package com.zh.custom.service;

import java.util.List;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jeesite.common.entity.Page;
import com.jeesite.common.service.CrudService;
import com.zh.custom.entity.Tcustomer;
import com.zh.custom.dao.TcustomerDao;
import com.jeesite.modules.file.utils.FileUploadUtils;

/**
 * 客户信息表Service
 * @author 690378361@163.com
 * @version 2025-08-31
 */
@Service
public class TcustomerService extends CrudService<TcustomerDao, Tcustomer> {
	
	/**
	 * 获取单条数据
	 * @param tcustomer
	 * @return
	 */
	@Override
	public Tcustomer get(Tcustomer tcustomer) {
		return super.get(tcustomer);
	}
	
	/**
	 * 查询分页数据
	 * @param tcustomer 查询条件
	 * @param tcustomer page 分页对象
	 * @return
	 */
	@Override
	public Page<Tcustomer> findPage(Tcustomer tcustomer) {
		return super.findPage(tcustomer);
	}
	
	/**
	 * 查询列表数据
	 * @param tcustomer
	 * @return
	 */
	@Override
	public List<Tcustomer> findList(Tcustomer tcustomer) {
		return super.findList(tcustomer);
	}
	
	/**
	 * 保存数据（插入或更新）
	 * @param tcustomer
	 */
	@Override
	@Transactional
	public void save(Tcustomer tcustomer) {
		super.save(tcustomer);
		// 保存上传图片
		FileUploadUtils.saveFileUpload(tcustomer, tcustomer.getId(), "tcustomer_image");
		// 保存上传附件
		FileUploadUtils.saveFileUpload(tcustomer, tcustomer.getId(), "tcustomer_file");
	}
	
	/**
	 * 更新状态
	 * @param tcustomer
	 */
	@Override
	@Transactional
	public void updateStatus(Tcustomer tcustomer) {
		super.updateStatus(tcustomer);
	}
	
	/**
	 * 删除数据
	 * @param tcustomer
	 */
	@Override
	@Transactional
	public void delete(Tcustomer tcustomer) {
		super.delete(tcustomer);
	}
	
}